package br.unicesumar.dao.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.MatchMode;
import org.hibernate.criterion.Restrictions;

import br.unicesumar.dao.GenericHibernateDao;
import br.unicesumar.persistence.Cliente;

public class ClienteDao extends GenericHibernateDao<Cliente, Long> {
	public List<Cliente> pesquisarClientePorCPF(String cpfCliente) {
		Criteria criteria = getSession().createCriteria(Cliente.class);
		if (cpfCliente != "") {
			criteria.add(Restrictions.like("cpf", cpfCliente,
					MatchMode.ANYWHERE));
		}
		return criteria.list();
	}
}
